package com.gmail.blackdog1987.onedollar.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;

/**
 * Created by dongguochao on 12/7/15.
 */
@Entity
@Table(name = "t_goods", schema = "", catalog = "onedollar")
public class TGoodsEntity {
    private int goodsId;

    @Id
    @Column(name = "goods_id", nullable = false, insertable = true, updatable = true)
    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    private Integer sellerId;

    @Basic
    @Column(name = "seller_id", nullable = true, insertable = true, updatable = true)
    public Integer getSellerId() {
        return sellerId;
    }

    public void setSellerId(Integer sellerId) {
        this.sellerId = sellerId;
    }

    private Integer brandId;

    @Basic
    @Column(name = "brand_id", nullable = true, insertable = true, updatable = true)
    public Integer getBrandId() {
        return brandId;
    }

    public void setBrandId(Integer brandId) {
        this.brandId = brandId;
    }

    private Integer catId;

    @Basic
    @Column(name = "cat_id", nullable = true, insertable = true, updatable = true)
    public Integer getCatId() {
        return catId;
    }

    public void setCatId(Integer catId) {
        this.catId = catId;
    }

    private String goodsName;

    @Basic
    @Column(name = "goods_name", nullable = true, insertable = true, updatable = true, length = 200)
    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    private String keywords;

    @Basic
    @Column(name = "keywords", nullable = true, insertable = true, updatable = true, length = 50)
    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    private Integer isShelves;

    @Basic
    @Column(name = "is_shelves", nullable = true, insertable = true, updatable = true)
    public Integer getIsShelves() {
        return isShelves;
    }

    public void setIsShelves(Integer isShelves) {
        this.isShelves = isShelves;
    }

    private String shelfCause;

    @Basic
    @Column(name = "shelf_cause", nullable = true, insertable = true, updatable = true, length = 100)
    public String getShelfCause() {
        return shelfCause;
    }

    public void setShelfCause(String shelfCause) {
        this.shelfCause = shelfCause;
    }

    private String goodsInfo;

    @Basic
    @Column(name = "goods_info", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getGoodsInfo() {
        return goodsInfo;
    }

    public void setGoodsInfo(String goodsInfo) {
        this.goodsInfo = goodsInfo;
    }

    private String goodsParam;

    @Basic
    @Column(name = "goods_param", nullable = true, insertable = true, updatable = true, length = 65535)
    public String getGoodsParam() {
        return goodsParam;
    }

    public void setGoodsParam(String goodsParam) {
        this.goodsParam = goodsParam;
    }

    private Integer isRecommend;

    @Basic
    @Column(name = "is_recommend", nullable = true, insertable = true, updatable = true)
    public Integer getIsRecommend() {
        return isRecommend;
    }

    public void setIsRecommend(Integer isRecommend) {
        this.isRecommend = isRecommend;
    }

    private Integer isDiscount;

    @Basic
    @Column(name = "is_discount", nullable = true, insertable = true, updatable = true)
    public Integer getIsDiscount() {
        return isDiscount;
    }

    public void setIsDiscount(Integer isDiscount) {
        this.isDiscount = isDiscount;
    }

    private Integer sortOrder;

    @Basic
    @Column(name = "sort_order", nullable = true, insertable = true, updatable = true)
    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    private Timestamp addTime;

    @Basic
    @Column(name = "add_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }

    private Timestamp updateTime;

    @Basic
    @Column(name = "update_time", nullable = true, insertable = true, updatable = true)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    private Integer status;

    @Basic
    @Column(name = "status", nullable = true, insertable = true, updatable = true)
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    private String memo;

    @Basic
    @Column(name = "memo", nullable = true, insertable = true, updatable = true, length = 100)
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    private Integer applyStatus;

    @Basic
    @Column(name = "apply_status", nullable = true, insertable = true, updatable = true)
    public Integer getApplyStatus() {
        return applyStatus;
    }

    public void setApplyStatus(Integer applyStatus) {
        this.applyStatus = applyStatus;
    }

    private Integer soldnumber;

    @Basic
    @Column(name = "soldnumber", nullable = true, insertable = true, updatable = true)
    public Integer getSoldnumber() {
        return soldnumber;
    }

    public void setSoldnumber(Integer soldnumber) {
        this.soldnumber = soldnumber;
    }

    private BigDecimal defaultPrice;

    @Basic
    @Column(name = "default_price", nullable = true, insertable = true, updatable = true, precision = 2)
    public BigDecimal getDefaultPrice() {
        return defaultPrice;
    }

    public void setDefaultPrice(BigDecimal defaultPrice) {
        this.defaultPrice = defaultPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TGoodsEntity that = (TGoodsEntity) o;

        if (goodsId != that.goodsId) return false;
        if (sellerId != null ? !sellerId.equals(that.sellerId) : that.sellerId != null) return false;
        if (brandId != null ? !brandId.equals(that.brandId) : that.brandId != null) return false;
        if (catId != null ? !catId.equals(that.catId) : that.catId != null) return false;
        if (goodsName != null ? !goodsName.equals(that.goodsName) : that.goodsName != null) return false;
        if (keywords != null ? !keywords.equals(that.keywords) : that.keywords != null) return false;
        if (isShelves != null ? !isShelves.equals(that.isShelves) : that.isShelves != null) return false;
        if (shelfCause != null ? !shelfCause.equals(that.shelfCause) : that.shelfCause != null) return false;
        if (goodsInfo != null ? !goodsInfo.equals(that.goodsInfo) : that.goodsInfo != null) return false;
        if (goodsParam != null ? !goodsParam.equals(that.goodsParam) : that.goodsParam != null) return false;
        if (isRecommend != null ? !isRecommend.equals(that.isRecommend) : that.isRecommend != null) return false;
        if (isDiscount != null ? !isDiscount.equals(that.isDiscount) : that.isDiscount != null) return false;
        if (sortOrder != null ? !sortOrder.equals(that.sortOrder) : that.sortOrder != null) return false;
        if (addTime != null ? !addTime.equals(that.addTime) : that.addTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;
        if (status != null ? !status.equals(that.status) : that.status != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (applyStatus != null ? !applyStatus.equals(that.applyStatus) : that.applyStatus != null) return false;
        if (soldnumber != null ? !soldnumber.equals(that.soldnumber) : that.soldnumber != null) return false;
        if (defaultPrice != null ? !defaultPrice.equals(that.defaultPrice) : that.defaultPrice != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = goodsId;
        result = 31 * result + (sellerId != null ? sellerId.hashCode() : 0);
        result = 31 * result + (brandId != null ? brandId.hashCode() : 0);
        result = 31 * result + (catId != null ? catId.hashCode() : 0);
        result = 31 * result + (goodsName != null ? goodsName.hashCode() : 0);
        result = 31 * result + (keywords != null ? keywords.hashCode() : 0);
        result = 31 * result + (isShelves != null ? isShelves.hashCode() : 0);
        result = 31 * result + (shelfCause != null ? shelfCause.hashCode() : 0);
        result = 31 * result + (goodsInfo != null ? goodsInfo.hashCode() : 0);
        result = 31 * result + (goodsParam != null ? goodsParam.hashCode() : 0);
        result = 31 * result + (isRecommend != null ? isRecommend.hashCode() : 0);
        result = 31 * result + (isDiscount != null ? isDiscount.hashCode() : 0);
        result = 31 * result + (sortOrder != null ? sortOrder.hashCode() : 0);
        result = 31 * result + (addTime != null ? addTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (applyStatus != null ? applyStatus.hashCode() : 0);
        result = 31 * result + (soldnumber != null ? soldnumber.hashCode() : 0);
        result = 31 * result + (defaultPrice != null ? defaultPrice.hashCode() : 0);
        return result;
    }
}
